/**
 * 转换器类
 */
import BaseType from './BaseType.js';
import TypeKind from '../enums/TypeKind.js';

export default class ConverterClass extends BaseType {

    logicType = '';
    abstractClass = false;
    superClassId = '';

    constructor(packageName, simpleName, logicType) {
        super(TypeKind.CONVERTER, packageName, simpleName);
        this.logicType = logicType;
    }

    static of(object) {
        if (typeof object !== 'object') {
            return undefined;
        }
        let clazz = new ConverterClass(object.packageName, object.simpleName, object.logicType);
        clazz.update(object);
        return clazz;
    }

    clone() {
        return ConverterClass.of(this);
    }

}
